<?php
/*
Created On: 25Nov, 2011.
Description: This file is used to confirm login in admin area.
*/
include_once("inc/config.php");

$index_path="welcome.php";
$objAdmin = new AdminMaster();
$fetchRow = $objAdmin->getAdminDetail($_POST['TR_Username'], $_POST['TR_Password']);


############################## if to check wether valid admin #############################################
if($fetchRow)
{  
	
	if($fetchRow['status']==0)
	{
		header("location: index.php?err=status");
		die();
	}
	else
	{				
		$sess_admin_name=$fetchRow['name'];
		$sess_admin_id=$fetchRow['id'];
		$sess_admin_status=$fetchRow['status'];	
        
		$_SESSION['sess_admin_name'] = $sess_admin_name;
		$_SESSION['sess_admin_id'] = $sess_admin_id;
		$_SESSION['sess_admin_status'] = $sess_admin_status;        
        $_SESSION['access_group'] = $fetchRow['access_group'];

		$objAdmin->adminTracking();
		header("location: $index_path");
		die();
	}
}
else
{
	   	header("location: index.php?err=login");
		die();
}

?>